﻿<%@ include file="/WEB-INF/views/jsp/common/taglibs.jsp" %>
<head>
    <title>${site}网购平台</title>
    <%@ include file="/WEB-INF/views/jsp/common/meta.jsp" %>
    <%@ include file="/WEB-INF/views/jsp/common/link.jsp" %>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/pc/css/base.css?1607170150.25"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/pc/css/page/welcome.css?1607170150.25"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/lib/chosen/chosen.min.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/pc/css/page/account/common.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/pc/css/page/account/datepicker.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/pc/css/page/account/setPersonal.css"/>
    <script src="${ctx}/static/pc/jsmin/jquery.js?1.12.4" type="text/javascript"></script>
    <script>
        fml.setOptions({
            'sversion': '1607170150.25',
            'defer': true,
            'modulebase': '${ctx}/static/pc/jsmin/'
        });
        var Meilishuo = {
            "config": {
                "nt": "1yQyN1tU7ssTVQ5GeZ16w7IF/0VPJbAp1lO2BxZa52X2e4+pti0UtSulDoUBzzqn",
                "main_site_domain": "/",
                "server_url": "/",
                "picture_url": "#",
                "captcha_url": "#",
                "im_url": "http://imlab.meilishuo.com/",
                "forSale": false,
                "controller": "welcome",
                "isLogin": true,
                "userInfo": {
                    "name": "阿猫来了",
                    "uid": "11cnkktq",
                    "avatar": "${ctx}/static/new1/v1/bdefaultavatar/03.jpg"
                }
            }
        };
        var provinceId = "${account.provinceId}";
        var cityId = "${account.cityId}";
        $(function() {
            $.ajax({
                url: '${ctx}/ajax/region/children/load',
                type: "post",
                dataType: "json",
                cache:false,
                data: {"parentId":1},
                success: function (data) {
                    if (data.statusCode == '1') {
                        $.each(data.result,function(index,obj) {
                            $("#province_id").append("<option value=" + obj.regionId + ">" + obj.regionName + "</option>" );
                        });
                        if(provinceId)
                            $('#province_id option[value="'+ provinceId +'"]').attr("selected", true);
                        loadChildren(document.getElementById("province_id"),true);
                    }
                }
            });

            //提交
            $("#submit").bind("click",function(){
                $.ajax({
                        type: "post",
                        dataType: "json",
                        url: '${ctx}/account/save',
                        data: $('#setPersonForm').serialize(),
                        success: function(data) {
                            if (data.statusCode == '1'){
                                alert("success");
                            }
                        }
                });
            });
        });

        function loadChildren(obj,bol) {
            $("#city_id").empty();
            $.ajax({
                url: '${ctx}/ajax/region/children/load',
                type: "post",
                dataType: "json",
                cache:false,
                data: {"parentId":obj.value},
                success: function (data) {
                    if (data.statusCode == '1') {
                        $.each(data.result,function(index,obj) {
                            $("#city_id").append("<option value=" + obj.regionId + ">" + obj.regionName + "</option>" )
                        });
                        if (bol) {
                            if(cityId)
                                $('#city_id option[value="'+ cityId +'"]').attr("selected", true);
                        }

                    }

                }
            });
        }
    </script>
</head>

<body>
<div class="head">
    <%@ include file="/WEB-INF/views/jsp/common/header.jsp" %>
</div>
<div class="settings">
    <%@ include file="/WEB-INF/views/jsp/common/consumer-navigator.jsp"%>
    <div class="settings_box">
        <strong class="settings_title">我的信息</strong>
        <fieldset class="setPersonal">
            <form id="setPersonForm">
                <input type="hidden" name="accountId" value="${account.accountId}"/>
                <div class="form-list">
                    <label class="account-label">注册邮箱</label>
                    <input id="register_mail" name="accountEmail" autocomplete="off" class="l_ipt" type="text" value="${account.accountEmail}" />
                    <strong></strong>
                </div>
                <div class="form-list">
                    <label class="account-label">真实姓名</label>
                    <input id="true_name" name="accountRealName" autocomplete="off" class="l_ipt" type="text" value="${account.accountRealName}" />
                    <strong></strong>
                </div>
                <div class="form-list">
                    <label class="account-label">昵称</label>
                    <input id="nickname" name="screenName" autocomplete="off" class="l_ipt" type="text" value="${account.screenName}" />
                    <strong></strong>
                </div>
                <div class="gender" id="gender">
                    <label class="account-label">性别</label>
                    <c:forEach var="genderType" items="${genderList}" varStatus="status">
                        <input name="gender" type="radio" id="gender${status.index}" value="${genderType.code}" class="regular-radio" <c:if test="${genderType.code eq account.gender}">checked</c:if>/>
                        <label for="gender${status.index}" class="regular-radio-label"></label>
                        <span><fmt:message key="def.account.gender.code.${genderType.code}.name" bundle="${def}"/></span>
                    </c:forEach>
                    <strong></strong>
                </div>
                <!--[if IE 8]>
                <div class="gender">
                    <label class="account-label">性别</label>
                    <c:forEach var="genderType" items="${genderList}" varStatus="status">
                        <input name="gender" style="margin-top:7px" type="radio" id="gender${status.index}" value="${genderType.code}" class="regular-radio" <c:if test="${genderType.code eq account.gender}">checked</c:if>/>
                        <label for="gender${status.index}" class="regular-radio-label"></label>
                        <span><fmt:message key="def.account.gender.code.${genderType.code}.name" bundle="${def}"/></span>
                    </c:forEach>
                </div>
                <![endif]-->
                <div class="form-list" id="birthday-list">
                    <label class="account-label">生日</label>
                    <input id="birthday" readonly class="laydate-icon" name="birthday" autocomplete="off" class="l_ipt" type="text" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${account.birthday}"/>" onfocus="HS_setDate(this)" />
                    <strong></strong>
                </div>
                <div class="form-list" id="area-list" data-province="0" data-city="0">
                    <label class="account-label">所在地</label>
                    <div class="select-container">
                        <select id="province_id" name="provinceId" onchange="loadChildren(this);"></select>
                    </div>
                    <div class="select-container">
                        <select id="city_id" name="cityId"></select>
                    </div>
                    <strong></strong>
                </div>
                <div class="form-list">
                    <label class="account-label">个人说明</label>
                    <textarea id="introduction" class="introduction" name="memo">${account.memo}</textarea>
                    <br/>
                    <strong class="introduction-error"></strong>
                </div>
                <input type="button" value="确 认" id="submit" class="ext_submit" />
                <span class="submitError"></span>
            </form>
        </fieldset>
    </div>
</div>
<!--[if IE 8]>
<script type="text/javascript">var genderEle = document.getElementById('gender');
genderEle.style.display = "none";</script>
<![endif]-->
<%@ include file="/WEB-INF/views/jsp/common/foot.jsp" %>
<p style="display: none" class="biu-login">11cnkktq</p>
<%@ include file="/WEB-INF/views/jsp/common/right-nav.jsp" %>
<script type="text/javascript" src="pc/jsmin/jquery.js?1.12.4"></script>
<script type="text/javascript" src="__static/logger/0.1.8/logger.js"></script>
<script src="__newtown/im_web/assets/common/openim/index.js"></script>
<script src="pc/~page/pcenter/common/navbar+page/account/common/calender+page/account/setPersonal/setPersonal+page/account/common/area+page/account/common/job+base?1607171729.25"></script>
<script>
    fml.use('page/pcenter/common/navbar');
    fml.use('page/account/common/calender');
    fml.use('page/account/setPersonal/setPersonal');
    fml.use('page/account/common/area');
    fml.use('page/account/common/job');
    fml.use('base');
    fml.iLoad();
</script>
</body>